//模拟栈

var arr = new Array(0)
function push(a) {  
  arr.push(a)
}
function pop() {  
  return arr.pop()
}
 
function  Stack(){
  this.arr = [];
  this.push = function(a) {  
    arr.push(a)
  }
  this.pop = function () {  
    return arr.pop()
  }
}
function  Queue(){
  this.arr = [];
  this.push = function(a) {  
    arr.push(a)
  }
  this.reduce = function () {  
    return arr.shift()
  }
}
const a = new Queue()

a.push(1)
a.push(2)
a.push(3)
a.push(4)
console.dir(a.arr)
console.log(a.reduce())
console.dir(a.arr)
console.log(a.reduce())
console.log(a.reduce())
console.log(a.reduce())
